package com.sinopec.basemodule.dialog;

import android.content.Context;
import android.util.DisplayMetrics;
import android.view.View;

import com.sinopec.basemodule.R;
import com.sinopec.basemodule.widget.popupwindow.BasePopup;

/**
 * @author lwj
 * @ClassName: MonthPickerPopupWindow
 * @Description: 账单年月选择控件
 * @date 2019/10/9 15:57
 */
public class MonthPickerPopupWindow extends BasePopup<MonthPickerPopupWindow> {

    private Context context;
    //消息弹出框监听器
    private OnDialogListener listener;

    public static MonthPickerPopupWindow create(Context context, OnDialogListener listener) {
        return new MonthPickerPopupWindow(context, listener);
    }

    protected MonthPickerPopupWindow(Context context, OnDialogListener listener) {
        this.context = context;
        this.listener = listener;
        setContext(context);
    }

    @Override
    protected void initAttributes() {
        setContentView(R.layout.popuwindow_picker_month);
        DisplayMetrics d = context.getResources().getDisplayMetrics();
        //设置弹窗宽高比例
        this.setWidth((int) (d.widthPixels * 1));
        this.setHeight((int) (d.heightPixels * 0.2));
        //setBackgroundDimEnable(true).setDimValue(0.5f);
    }

    @Override
    protected void initViews(View view, MonthPickerPopupWindow popup) {

    }

    public interface OnDialogListener {

        /**
         * 切换订单列表
         */
        void switchOrder(String type);
    }

}
